{extend name="public:_base" /}
{block name="css"}
{load href="__STATIC__/admin/uploadify/uploadify.css" /}
<script type="text/css">
    .clearfix:after{content:"\20";display:block;height:0;clear:both;visibility:hidden}.clearfix{zoom:1}
    .tabBar {border-bottom: 2px solid #222}
    .tabBar span {background-color: #e8e8e8;cursor: pointer;display: inline-block;float: left;font-weight: bold;height: 30px;line-height: 30px;padding: 0 15px}
    .tabBar span.current{background-color: #222;color: #fff}
    .tabCon {display: none}
</script>
{/block}
{block name="js"}
{include file="public/_validform"}
<!--上传配置 -->
<script src="__STATIC__/admin/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/upfile.js" type="text/javascript"></script>

<!-- 配置文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.all.js"></script>

<script type="text/javascript">
    $("[name='pctemplate']").find("[value='{$data.pctemplate.value ?? ''}']").attr("selected", true);
    $("[name='mobiletemplate']").find("[value='{$data.mobiletemplate.value ?? ''}']").attr("selected", true);

    var ue = UE.getEditor('editor',{
        toolbars: [
            ['fullscreen', 'source', '|', 'undo', 'redo', '|','bold','link', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc','map',]
        ],
        initialFrameHeight:150,
    });
    var URL = {
            uploader: '{:url('Upload/image')}',
            swf:'__STATIC__/admin/uploadify/uploadify.swf',
            ROOT:'__PUBLIC__/uploads/image',
    }
    upload_image('image','','','');
    upload_image('code','','150','150');
    upload_image('codeexe','','150','150');
    upload_image('ICO','*.ico','32','32');
    jQuery.Huitab =function(tabBar,tabCon,class_name,tabEvent,i){
        var $tab_menu=$(tabBar);
        // 初始化操作
        $tab_menu.removeClass(class_name);
        $(tabBar).eq(i).addClass(class_name);
        $(tabCon).hide();
        $(tabCon).eq(i).show();

        $tab_menu.bind(tabEvent,function(){
            $tab_menu.removeClass(class_name);
            $(this).addClass(class_name);
            var index=$tab_menu.index(this);
            $(tabCon).hide();
            $(tabCon).eq(index).show()})}
    $(function(){
        $.Huitab("#tab_demo .tabBar span","#tab_demo .tabCon","current","click","0")});

</script>
{/block}

{block name="main"}
<article class="page-container">

    <form class="form form-horizontal" action="{:url(\''.\\think\\Request::instance()->controller().'/save')}" id="form" method="post">

        <div id="tab_demo" class="HuiTab">

            <div class="tabBar clearfix">
                <span>系统设置</span><span >模版设置</span><span>邮箱设置</span>
            </div>

            <!--/系统设置-->
            <div class="tabCon">
                <table class="table table-border  table-bg table-style">
                    <tbody>
                        <tr>
                            <th><span class="c-red">*</span>网站名称：</th>
                            <td>
                                <input type="text" class="input-text" value="{$data.title.value ?? ''}" placeholder="控制在25个字、50个字节以内" datatype="*"  name="title">
                            </td>
                        </tr>
                        <tr>
                                <th>网站网址：</th>
                                <td>
                                    <input type="text" class="input-text" value="{$data.localhost.value ?? ''}" placeholder="{:\\think\\Request::instance()->domain()}" name="localhost">
                                </td>
                            </tr>
                        <tr>
                            <th>联系电话：</th>
                            <td>
                                <input type="text" class="input-text" value="{$data.advisory.value ?? ''}" placeholder="" name="advisory">
                            </td>
                        </tr>

                        <tr>
                            <th>邮箱地址：</th>
                            <td>
                                <input type="text" class="input-text" value="{$data.mail.value ?? ''}" placeholder="" name="mail">
                            </td>
                        </tr>

                        <tr>
                            <th>联系地址：</th>
                            <td>
                                <input type="text" class="input-text" value="{$data.address.value ?? ''}" placeholder="" name="address">
                            </td>
                        </tr>

                        <tr>
                            <th>
                                网站LOGO：<br>
                                <font style="color:#f00;">尺寸 162*70：</font>
                            </th>

                            <td>
                                <div id="image_s">
                                    <img onmouseover="layer_tips=layer.tips('<img src=__PUBLIC__/uploads/{$data.LOGO.value ?'image/'.$data.LOGO.value: 'sm_nopic.jpg'} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});" onmouseout="layer.close(layer_tips);"  src="__PUBLIC__/uploads/{$data.LOGO.value ?'image/'.$data.LOGO.value: 'sm_nopic.jpg'}" width="80px" height="80px"/>

                                </div>
                                <input name="LOGO" id="image_post" type="hidden" value="{$data.LOGO.value ?: ''}"/>
                                <input id="image" name="image_upload" type="file" multiple="true">
                            </td>
                        </tr>

                        <tr>
                            <th>
                                公众号二维码<br>
                                <font style="color:#f00;">尺寸 150*150：</font>
                            </th>

                            <td>
                                <div id="code_s">
                                    <img onmouseover="layer_tips=layer.tips('<img src=__PUBLIC__/uploads/{$data.code.value ?'image/'.$data.code.value: 'sm_nopic.jpg'} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});" onmouseout="layer.close(layer_tips);"  src="__PUBLIC__/uploads/{$data.code.value ?'image/'.$data.code.value: 'sm_nopic.jpg'}" width="80px" height="80px"/>

                                </div>
                                <input name="code" id="code_post" type="hidden" value="{$data.code.value ?: ''}"/>
                                <input id="code" name="code_upload" type="file" multiple="true">
                            </td>
                        </tr>

                        <tr>
                            <th>
                                小程序二维码<br>
                                <font style="color:#f00;">尺寸 150*150：</font>
                            </th>

                            <td>
                                <div id="codeexe_s">
                                    <img onmouseover="layer_tips=layer.tips('<img src=__PUBLIC__/uploads/{$data.codeexe.value ?'image/'.$data.codeexe.value: 'sm_nopic.jpg'} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});" onmouseout="layer.close(layer_tips);"  src="__PUBLIC__/uploads/{$data.codeexe.value ?'image/'.$data.codeexe.value: 'sm_nopic.jpg'}" width="80px" height="80px"/>
                                </div>
                                <input name="codeexe" id="codeexe_post" type="hidden" value="{$data.codeexe.value ?: ''}"/>
                                <input id="codeexe" name="codeexe_upload" type="file" multiple="true">
                            </td>
                        </tr>

                        

                        <tr>
                            <th><span class="c-red">*</span>企业关键词：</th>
                            <td>
                                <input type="text" class="input-text" value="{$data.keywords.value ?? ''}" placeholder="5个左右,8汉字以内,用英文,隔开" datatype="*" name="keywords">
                            </td>
                        </tr>

                        <tr>
                            <th>
                                地址栏图标：<br>
                                <font style="color:#f00;">尺寸 32*32：</font>
                            </th>

                            <td>
                                <div id="ICO_s">
                                    <img src="__PUBLIC__/uploads/{$data.ICO.value ?'image/'.$data.ICO.value: 'sm_20.jpg'}" width="20px" height="20px"/>
                                </div>
                                <input name="ICO" id="ICO_post" type="hidden" value="{$data.ICO.value ?: ''}"/>
                                <input id="ICO" name="ICO_upload" type="file" multiple="true">
                                <span class="tips">建议尺寸 32 * 32 (像素)的.ico文件。<a href="https://www.baidu.com/s?wd=ico%E5%9B%BE%E6%A0%87%E5%88%B6%E4%BD%9C" style="color:#f00;" target="_blank">点击制作ICO</a>
                                <br>
                                如果无法正常显示新上传图标，清空浏览器缓存后访问。
                                </span>
                            </td>
                        </tr>

                        <tr>
                            <th>
                                <span class="c-red">*</span>企业描述：
                            </th>

                            <td class="textarea-valid">
                                <textarea name="description" cols="" rows="" class="input-text textarea" placeholder="说点什么...最少输入10个字符" datatype="*10-100" onKeyUp="$.Huitextarealength(this,200)" nullmsg="限制10-100个字符!">{$data.description.value ?? ''}</textarea>
                            </td>
                        </tr>

                        <tr>
                            <th class="th-ge" colspan="2" scope="col">底部信息设置（显示在网站前台底部）</th>
                        </tr>

                        <tr>
                            <th>底部信息：</th>
                            <td>
                                <script id="editor" type="text/plain" name="count" style="width:100%;">{$data.count.value|default=''|html_entity_decode ?? ''}</script>
                            </td>
                        </tr>
                    </tbody>

                    <tfoot>
                        <tr>
                            <th></th>
                            <td>
                                <input name="type" value="{$type}" type="hidden"/>
                                <input class="btn radius btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                                <input class="btn radius btn-default radius" type="reset" value="&nbsp;&nbsp;重设&nbsp;&nbsp;">
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
             <!--/系统设置-->

            <!--模版设置-->
            <div class="tabCon">
                <table class="table table-border  table-bg table-style">
                    <tbody>
                        <tr>
                            <th>PC模板：</th>
                            <td>
                                <select name="pctemplate" class="select">
                                    {volist name='pctemplate' id='vo'}
                                    <option value="{$vo.dirname}" >{$vo.name} ( {$vo.dirname} )</option>
                                    {/volist}
                                </select>
                            </td>
                        </tr>

                        <tr>
                            <th>手机模板：</th>
                            <td>
                                <select name="mobiletemplate" class="select">
                                    {volist name='mobiletemplate' id='vo'}
                                    <option value="{$vo.dirname}" >{$vo.name} ( {$vo.dirname} )</option>
                                    {/volist}
                                </select>
                            </td>
                        </tr>
                    </tbody>

                    <tfoot>
                        <tr>
                            <th></th>
                            <td>
                                <input name="type" value="{$type}" type="hidden"/>
                                <input class="btn radius btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                                <input class="btn radius btn-default radius" type="reset" value="&nbsp;&nbsp;重设&nbsp;&nbsp;">
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
            <!--/模版设置-->

            <!--邮箱设置-->
            <div class="tabCon">
                <table class="table table-border  table-bg table-style">
                    <tbody>
                        <tr>
                            <th>
                                <span class="c-red">*</span>邮件发送模式：
                            </th>

                            <td>
                                <input type="text" class="input-text" value="{$data.emailSecure.value ??'ssl'}" placeholder="ssl" datatype="s" name="emailSecure">
                            </td>
                        </tr>

                        <tr>
                            <th>
                                <span class="c-red">*</span>SMTP服务器：
                            </th>

                            <td>
                                <input type="text" class="input-text" value="{$data.emailHost.value ??'stmp.sina.com'}" placeholder="smtp.qq.com" datatype="*" name="emailHost">
                            </td>
                        </tr>

                        <tr>
                            <th>
                                <span class="c-red">*</span>SMTP端口：
                            </th>

                            <td>
                                <input type="text" class="input-text" value="{$data.emailPort.value ??'465'}" placeholder="25或465" datatype="n" name="emailPort">
                            </td>
                        </tr>

                        <tr>
                            <th>
                                <span class="c-red">*</span>邮箱帐号：
                            </th>

                            <td>
                                <input type="email" class="input-text" value="{$data.emailName.value ??'admin@admin.com'}" id="emailName" placeholder="邮箱账号" datatype="e" name="emailName" >
                            </td>
                        </tr>

                        <tr>
                            <th>
                                <span class="c-red">*</span>邮箱密码：
                            </th>

                            <td>
                                <input type="password" id="email-password" value="{$data.emailpassword.value ??'1'}" placeholder="邮箱密码" name="emailpassword" datatype="*"  class="input-text" >
                            </td>
                        </tr>
                    </tbody>

                    <tfoot>
                        <tr>
                            <th></th>
                            <td>
                                <input name="type" value="{$type}" type="hidden"/>
                                <input class="btn radius btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                                <input class="btn radius btn-default radius" type="reset" value="&nbsp;&nbsp;重设&nbsp;&nbsp;">
                                <a class="btn radius btn-default radius" data-title="测试邮箱" data-href="{:url(\''.$Request.controller.'/checkmail')}" onclick="Hui_admin_tab(this)" href="javascript:;">测试邮箱</a>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
            <!--/邮箱设置-->
        </div>

    </form>

</article>
{/block}